package com.woniuxy.thread;

/**
 * 饿汉模式
 *
 * @author 老谭 (<a href="http://www.woniuxy.com">蜗牛学苑</a>)
 *
 */
public class Singleton2 {
	private Singleton2() {

	}

	private static Singleton2 singleton2 = new Singleton2();

	public static int num;// 访问该静态属性时，类会被加载，导致singleton2会被初始化

	public static Singleton2 getInstance() {
		return singleton2;
	}

}
